package site.jlopen.assets.webflux;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.http.HttpHeaders;
import org.springframework.http.client.reactive.ClientHttpRequest;
import org.springframework.web.reactive.function.BodyInserter;
import org.springframework.web.reactive.function.client.WebClient;

import lombok.extern.slf4j.Slf4j;

@Configuration
@Slf4j
public class WebfluxClientConfig {

	/*@Bean
	public WebClient webClient(WebClient.Builder builder) {
		return builder.baseUrl("https://apiv2.xinnet.com")
				.defaultHeader(org.springframework.http.HttpHeaders.CONTENT_TYPE, "application/json")
				.filter((request, next) -> {
					log.info("请求地址{}", request.url());
					HttpHeaders headers = request.headers();
					headers.forEach((t, u) -> {
						log.info("请求头{}:{}", t, u);
					});
					BodyInserter <?, ? super ClientHttpRequest>  bodystr = request.body();
					log.info("请求内容{}", bodystr);
					return next.exchange(request);
				}).build();
	}*/

}
